import Vue from 'vue';
import Vuex from 'vuex';
import {getDetail} from "../common/http";

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        // imgUrl: 'http://118.178.107.9:88',
        imgUrl: 'https://tjasz.com',
        // imgUrl: 'https://zuji.usuzck.top',
        // imageUrl: 'https://zuji.usuzck.top/static/mp/images/',
        imageUrl: 'https://tjasz.com/static/mp/images/',
        // imageUrl: 'http://118.178.107.9:88/static/mp/images/',
        // detail: {},
    },
    mutations: {
        DETAIL(state, data){
            state.detail = data
        },
    },
    actions: {
        async fetchDetail({ commit }, payload){
            let reslut = await getDetail(payload)
            if(reslut.data.code === 0){
                commit('DETAIL',reslut.data.data)
            }
        },
    },
    modules:{

    }
})

export default store
